package com.rambo.dsd.sys.dao.inter.po;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * Create by Rambo on 2017/6/21
 **/
@Entity(name = "user")
public class UserPO {
    private String uuid;
    private String name;
    private String passwd;
    private String sex;
    private Date birthday;
    private String phone;
    private String photo;
    private String email;
    private String yxbz;
    private String sorts;

    @Id
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    @GeneratedValue(generator = "system-uuid")
    @Column(name = "UUID")
    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    @Basic
    @Column(name = "NAME")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "PASSWD")
    public String getPasswd() {
        return passwd;
    }

    public void setPasswd(String passwd) {
        this.passwd = passwd;
    }

    @Basic
    @Column(name = "SEX")
    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Basic
    @Column(name = "BIRTHDAY")
    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    @Basic
    @Column(name = "PHONE")
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Basic
    @Column(name = "PHOTO")
    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    @Basic
    @Column(name = "EMAIL")
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Basic
    @Column(name = "YXBZ")
    public String getYxbz() {
        return yxbz;
    }

    public void setYxbz(String yxbz) {
        this.yxbz = yxbz;
    }

    @Basic
    @Column(name = "SORTS")
    public String getSorts() {
        return sorts;
    }

    public void setSorts(String sorts) {
        this.sorts = sorts;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;

        UserPO userPO = (UserPO) o;

        if (uuid != null ? !uuid.equals(userPO.uuid) : userPO.uuid != null)
            return false;
        if (name != null ? !name.equals(userPO.name) : userPO.name != null)
            return false;
        if (passwd != null ? !passwd.equals(userPO.passwd) : userPO.passwd != null)
            return false;
        if (sex != null ? !sex.equals(userPO.sex) : userPO.sex != null)
            return false;
        if (birthday != null ? !birthday.equals(userPO.birthday) : userPO.birthday != null)
            return false;
        if (phone != null ? !phone.equals(userPO.phone) : userPO.phone != null)
            return false;
        if (photo != null ? !photo.equals(userPO.photo) : userPO.photo != null)
            return false;
        if (email != null ? !email.equals(userPO.email) : userPO.email != null)
            return false;
        if (yxbz != null ? !yxbz.equals(userPO.yxbz) : userPO.yxbz != null)
            return false;
        if (sorts != null ? !sorts.equals(userPO.sorts) : userPO.sorts != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = uuid != null ? uuid.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (passwd != null ? passwd.hashCode() : 0);
        result = 31 * result + (sex != null ? sex.hashCode() : 0);
        result = 31 * result + (birthday != null ? birthday.hashCode() : 0);
        result = 31 * result + (phone != null ? phone.hashCode() : 0);
        result = 31 * result + (photo != null ? photo.hashCode() : 0);
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (yxbz != null ? yxbz.hashCode() : 0);
        result = 31 * result + (sorts != null ? sorts.hashCode() : 0);
        return result;
    }
}